<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>add cate</title>
	<link rel="stylesheet" href="styles/backstage.css">
	<script type="text/javascript" src="./scripts/jquery-1.6.4.js"></script>
	<script type="text/javascript">
		function check(){

			if(document.getElementById('cName').value == ''){
				alert("请输入咨询分类名称!");
				return false;
			}

			return checkCate();

		}

		function checkCate(){
			var url = "doAdminAction.php?act=checkCate";  
			var name = document.getElementById('cName').value
			var flag = true;
			$.ajax({  
				type: "POST",  
				url: url,  
				async: false,
			// dataType: "json",  
			data: {cateName:name},  
			success: function(msg){ 
				if(msg){
					alert(msg); 
					flag = false;
				}
			}
		});
			return flag;
		}

	</script>

</head>
<body>
	<br/>
	<h3>添加分类</h3>
	<br/>
	<!-- <form action="doAdminAction.php?act=addConCate" method="post" onsubmit="return check()"> -->
	<form action="doAdminAction.php?act=addConCate" method="post" >

		<table class="table" cellpadding="5" cellspacing="0" >
			<tr>
				<th align="right">咨询分类名称</th>	
				<td><input type="text" id = "cName" name="cName" class="search" placeholder="请输入咨询分类名称"/></td>
			</tr>
			<tr>
				<td colspan="2" align="center"><input type="submit" class="btn"  value="添加分类"/></td>
			</tr>

		</table>
	</form>
</body>
</html>